import React, { Component } from "react";
import Server from "./components/Server";
import List from "./components/List";
// import "./App.css";
export default class App extends Component {
  state = {
    //初始化状态
    users: [],
    isFrist: true, //是否是第一次打开页面
    isLoading: false, //标识是否处于加载中
    err: "", //存储请求相关的错误信息
  };
  upDateArr = (usersObj) => {
    //把方法传到子组件里面
    this.setState(usersObj);
  };
  render() {
    return (
      <div>
        <div className="container">
          <Server upDateArr={this.upDateArr} />
          <List {...this.state} />
        </div>
      </div>
    );
  }
}
